import request from "../utils/request";

export function fetchList(params) {
  return request({
    url: "/robot-map/v1/list",
    method: "get",
    params,
  });
}

export function createMap(data) {
  return request({
    url: "/robot-map/v1/add",
    method: "post",
    data,
  });
}

export function deleteMap(id) {
  return request({
    url: `/robot-map/v1/${id}`,
    method: "delete",
  });
}

export function updateMap(data) {
  return request({
    url: `/robot-map/v1/update`,
    method: "put",
    data,
  });
}

export function createChargePoint(data) {
  return request({
    url: "/robot-disinfect-charge-point/v1/create",
    method: "post",
    data,
  });
}

export function getChargePoint(mid) {
  return request({
    url: `/robot-disinfect-charge-point/v1/getListByMid/${mid}`,
    method: "get",
  });
}

export function updateChargePoint(data) {
  return request({
    url: "/robot-disinfect-charge-point/v1/update",
    method: "put",
    data,
  });
}

export function collectChargePoint(code, mid) {
  return request({
    url: `/wisdom-auto-inspection/v1/getChargeCoordinate/${code}/${mid}`,
    method: "get",
  });
}
